const Router = require('koa-router')
const axios = require('axios')
const config = require('../config')

const mockRouter = new Router({
  prefix: '/recordApi/mock'
})

mockRouter.get('/checked/:patientId', async ctx => {
  let patientId = ctx.params.patientId
  ctx.body = {
    checked: [{
      hospital: '杭州市第一医院',
      name: '血检',
      dateTime: '2018-11-11 00:00',
      data: [
        {
          item: '白细胞计数',
          value: 6.31,
          rangeStart: 4.00,
          rangeEnd: 10.00,
          unit: '10^9/L'
        }, {
          item: '淋巴细胞百分比(%)',
          value: 38.5,
          rangeStart: 20.0,
          rangeEnd: 40.00,
          unit: '%'
        }, {
          item: '中值细胞百分比(%)',
          value: 6.31,
          rangeStart: 4.00,
          rangeEnd: 10.00,
          unit: '10^9/L'
        }, {
          item: '中性细胞百分比(%)',
          value: 56.7,
          rangeStart: 50.0,
          rangeEnd: 70.0,
          unit: '%'
        }, {
          item: '淋巴细胞数',
          value: 8.1,
          rangeStart: 0.8,
          rangeEnd: 4,
          unit: '10^9L'
        }, {
          item: '中值细胞数',
          value: 1.4,
          rangeStart: 2,
          rangeEnd: 7.7,
          unit: '10^9L'
        }, {
          item: '中性细胞数',
          value: 6.9,
          rangeStart: 2,
          rangeEnd: 7,
          unit: '10^9L'
        }, {
          item: '红细胞计数',
          value: 6.2,
          rangeStart: 3.5,
          rangeEnd: 5.5,
          unit: '10^12L'
        }, {
          item: '红细胞积压',
          value: 35.4,
          rangeStart: 33.5,
          rangeEnd: 45,
          unit: '%'
        }, {
          item: '嗜酸性粒细胞百分比(EO%)',
          value: 1.3,
          rangeStart: 0.5,
          rangeEnd: 5.0,
          unit: '%'
        }
      ]
    }]
  }
})

mockRouter.get('/diagnosis/generate/:recordId', async ctx => {
  ctx.body = [
    {
      diseaseCode: '',
      diseaseName: '肺水肿',
      itemModulus: 0.88,
      caseMinRate: 0,
      caseMaxRate: 0
    },
    {
      diseaseCode: '',
      diseaseName: '肺炎',
      itemModulus: 0.72,
      caseMinRate: 0,
      caseMaxRate: 0
    },
    {
      diseaseCode: '',
      diseaseName: '肺结核',
      itemModulus: 0.68,
      caseMinRate: 0,
      caseMaxRate: 0
    },
    {
      diseaseCode: '',
      diseaseName: '肺癌',
      itemModulus: 0.51,
      caseMinRate: 0,
      caseMaxRate: 0
    },
  ]
})
module.exports = mockRouter